Cost: | Difficulty: | Danger 1: (No Hazards) | Utility: |
------------------------
Computing Bouts of the Prisoner's Dilemma |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
--------------------- |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
by Alun
L. Lloyd |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
--------------------- |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
COOPERATING WITH OTHERS AND exploiting them for personal gain are the two main ways members of a society can interact. To gain further insight into the social dynamics of competing individuals, researchers have formalized the choices within a mathematical framework known as game theory. They have devised various strategies about when to cooperate and have pitted those schemes against one another to determine the most successful. Such analyses indicate that cooperation often emerges naturally in simple societies; moreover, members can often fend off cutthroat exploiters from the outside [see "The Arithmetics of Mutual Help," by Martin A. Nowak, Robert M. May and Karl Sigmund, page 76]. Many of these notions derive from the classic game called the Prisoner's Dilemma. A player can cooperate with opponents or try to cheat them (called defecting). The opponent, of course, faces the same choice. With this game and some programming, a reader can explore the concept of mutual help, without going to prison. I describe a spatial setup, where players inhabit the squares of an oversize chessboard and spend their time repeatedly playing rounds of the Prisoner's Dilemma against their neighbors. To simplify the programming, I ignored corners and edges of the chessboard and instead considered the squares to wrap back around on themselves. All the games in each round are played at the same time. Within each round, every player takes on, one at a time, its eight nearest neighbors and itself (this self-interaction is included to make the computer program simpler). The players earn points depending on the strategy they and their opponents play. Each one gets a point if both cooperate; none if both defect. The player receives nothing if it cooperates and the opponent defects. The highest score, which I have labeled b, is for cheating (a player defects as the opponent cooperates). The value of b will ultimately control the outcome of the game. Just pick a value greater than 1; I used 1.85. A table known as a payoff matrix summarizes the scoring; it lists the rewards for the four different possible combinations of strategies [see illustration in sidebar, right ]. The nine payoffs resulting from the play are added up to give each player's score in that round. Each player then looks to see if any of its eight neighbors earned a score higher than it did. If so, the player will adopt the more successful strategy for the next round. For instance, if the opponent with the highest score in the player's neighborhood cooperated, the player will cooperate in the next round. If you play the game once, against just one other player, your best choice is to defect. Betrayal maximizes your score regardless of what your opponent does. In the spatial game, however, the outcome is harder to predict because the strategy each player adopts in the next round depends on the scores of its neighbors as well as its own. In turn, each neighbor's score depends on its nearest neighbors, which means that the configuration of the nearest 24 players affects the outcome at each square of the chessboard. I wrote the program in a dialect of the BASIC language called Q-BASIC, which comes with recent versions of MS-DOS for PC-compatible computers. It will work with Microsoft's QuicksAsc on the PC or the Macintosh and can easily be converted to run with other computer languages. The code is listed below, and the explanation of its function appears in the sidebar on the right. Once the program is working, you can adjust several parameters to influence the outcomes. As I mentioned, the game turns largely on the value of b, the advantage for hoodwinking. As b increases, defectors do better when they come across cooperators. Surrounding defectors always exploit lone cooperators, which always do worse. But groups of cooperators can help one another to flourish. One example is a square of four cooperators in a sea of defectors. Each cooperator will score four points (one from playing with each of its three neighbors and one from playing against itself), but the defectors neighboring the cooperators will score at most 2b because they are next to, at most, two cooperators. If b is not too large, cooperators will score higher than defectors. Lone defectors will do well because they are surrounded by cooperators. The outcome of the competition between such different circumstances is that clusters of defectors and cooperators are seen to grow and shrink, to collide and tear one another apart. Often a dynamic equilibrium results. From a distance, an overall pattern is discernible, but individual squares are constantly changing. Because each square's payoff is some multiple of b plus some multiple of 1, there is only a certain set of b values for which the behavior changes. The first experiment you could carry out is to run the program for different b values between 1 and 3. Try, for instance, 1.15,1.35, 1.55,1.77, 1.9 and 2.01. For the smaller b values, the defectors tend to be isolated, but for larger ones they form connected structures. Once you have seen some of the different behaviors, you may want to describe them in more quantitative terms. Count the numbers of cooperators and defectors (identified by a total of four colors, depending on the strategies played over two rounds) in each round. How do these quantities vary as the contest continues? For some b values, these frequencies get progressively closer to some fixed value; for others, they vary d. A periodically (for instance, taking one of two values, depending on whether the round is even or odd) or even in an unpredictable fashion. Calculate the fraction of players that change their strategies in each round. If it equals 0, you have reached a static equilibrium. Graphically, the situation shows up as all squares being two colors. (Such a pattern occurs when b is set to 2.01.) Is the initial proportion of defectors to cooperators important for these results? Try running the program several times with different ratios. The clustering of defectors and cooperators is also crucial. If the number of cooperators is small, on some occasions they may be clustered and can flourish. On others, they may be isolated and are doomed. This program can generate some pretty patterns if the initial configuration is symmetrical. It is easy to modify the code so that every square at first is a cooperator. Remove the line in the program that decides whether a square should start off as a defector. Now set just one square, near the center, to be a defector. (Insert the line s(30,30) = 2, for instance, just after the loop that now sets all squares to be cooperators.) Choose a b value between 1.8 and 2 and start the program. You should see that the single defector can invade the world of cooperators [see Figure 1]. Another easy modification is to play the game only against the eight neighbors. To do this, do not add on the payoff when the square plays against itself (when k = 0 and l = 0 in the program). Similar behaviors will be seen but with slightly different b values. Or try different boundary conditions-for instance, unwrap the chessboard and let the edge players compete against their five neighbors and the corner players their three. This scenario can be messier to program, as edge and corner squares must be treated differently. Another alternative would be to insist that all corner and edge squares always cooperate or always defect. An interesting change would be to play the game against only the four nearest neighbors (up, down, left and right). For those of you who like a challenge, try setting up the game on a honeycomb-pattern board, so that each square has six neighbors. Further explorations could include altering more than one entry in the payoff matrix. Small changes, such as setting the entry at the bottom right in the payoff matrix (both player and opponent defecting) to a tiny positive value such as 0.01, do not alter overall behavior very much More radical changes will have a noticeable effect. The number of possible manipulations of the program is almost limitless, as will be the patterns produced.
ALUN L. LLOYD is a graduate student in the department of zoology at the University of Oxford. His interests include mathematical biology and nonlinear dynamics (that is, chaos). His research is supported by the Wellcome Trust. Suppliers and Organizations The Society for Amateur Scientists (SAS) is a nonprofit research and educational organization dedicated to helping people enrich their lives by following their passion to take part in scientific adventures of all kinds. The Society for Amateur Scientists |